package com.xinz.srmi.impl.serialization;
/**
 * 属性访问器，用于直接的设置和获取某个对象的指定类型的属性
 * 访问器可以避免访问基本数据类型时候封装成对象
 * @author xingyun
 *
 */
public interface Accessor {
	
	int getInt()throws IllegalAccessException ;
	void setInt(int value)throws IllegalAccessException ;
	
	String getString()throws IllegalAccessException ;
	void setString(String value)throws IllegalAccessException ;
	
	float getFloat()throws IllegalAccessException ;
	void setFloat(float value)throws IllegalAccessException ;
	
	boolean getBoolean()throws IllegalAccessException ;
	void setBoolean(boolean value)throws IllegalAccessException ;
	
	void setLong( long value)throws IllegalAccessException;
	long getLong()throws IllegalAccessException ;
	
	Object get()throws IllegalAccessException ;
	void set(Object value)throws IllegalAccessException ;
	Class<?> getType()throws IllegalAccessException ;
	void setShort(short readShort)throws IllegalAccessException ;
	short getShort()throws IllegalAccessException ;
	double getDouble()throws IllegalAccessException ;
	void setDouble(double readDouble)throws IllegalAccessException ;
	int getChar()throws IllegalAccessException ;
	void setChar(char readChar)throws IllegalAccessException ;
	void setByte(byte readByte)throws IllegalAccessException ;
	byte getByte()throws IllegalAccessException ;
	boolean isNull()throws IllegalAccessException ;
	Accessor EMPTY = new Abstract ();
	public static class Abstract implements Accessor{
		@Override
		public int getInt() throws IllegalAccessException {
			return 0;
		}

		@Override
		public void setInt(int value) throws IllegalAccessException {

		}

		@Override
		public String getString() throws IllegalAccessException {
			return null;
		}

		@Override
		public void setString(String value) throws IllegalAccessException {

		}

		@Override
		public float getFloat() throws IllegalAccessException {
			return 0;
		}

		@Override
		public void setFloat(float value) throws IllegalAccessException {

		}

		@Override
		public boolean getBoolean() throws IllegalAccessException {
			return false;
		}

		@Override
		public void setBoolean(boolean value) throws IllegalAccessException {

		}

		@Override
		public void setLong(long value) throws IllegalAccessException {

		}

		@Override
		public long getLong() throws IllegalAccessException {
			return 0;
		}

		@Override
		public Object get() throws IllegalAccessException {
			return null;
		}

		@Override
		public void set(Object value) throws IllegalAccessException {

		}

		@Override
		public Class<?> getType() throws IllegalAccessException {
			return null;
		}

		@Override
		public void setShort(short readShort) throws IllegalAccessException {

		}

		@Override
		public short getShort() throws IllegalAccessException {
			return 0;
		}

		@Override
		public double getDouble() throws IllegalAccessException {
			return 0;
		}

		@Override
		public void setDouble(double readDouble) throws IllegalAccessException {

		}

		@Override
		public int getChar() throws IllegalAccessException {
			return 0;
		}

		@Override
		public void setChar(char readChar) throws IllegalAccessException {

		}

		@Override
		public void setByte(byte readByte) throws IllegalAccessException {

		}

		@Override
		public byte getByte() throws IllegalAccessException {
			return 0;
		}

		@Override
		public boolean isNull() throws IllegalAccessException {
			return false;
		}
	};

	
}
